package com.lingkun.demo.config.mybatisplus;


import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@MapperScan("com.lingkun.demo.sys.mapper")
@Configuration
@EnableTransactionManagement
public class mybatisconfig {


    public mybatisconfig() {
    }


    //乐观锁配置插件  字段上加上version注解
//    @Bean
//    public OptimisticLockerInterceptor  optimisticLockerInterceptor(){
//          return  new OptimisticLockerInterceptor();
//      }

    // 分页配置插件
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }

    //逻辑删除插件
//    @Bean
//    public ISqlInjector sqlInjector(){
//          return new LogicSqlInjector();
//    }

}
